import { defineStore } from "pinia";
import { screenConsoleKey } from "../key";
import { ScreenConsoleApiModel } from "@/type/console/screenConsole";

interface IBasicState {
  screenConsoleState: ScreenConsoleApiModel

}

export const useScreenStore = defineStore(screenConsoleKey, {
  state(): IBasicState {
    return {
      screenConsoleState: {
        label: {
            labelPosition: 1,
            showOnlyOnActivated: true,
        },
        tools: {
            showAvatarTitle: false,//头像
            showHomeButton: true,//主页
            showSearchBoxTitle: false,//搜索栏
            showDownloadButton: false,//下载按钮
            showBookmarkMenu:true,//收藏栏
            showBookmarkMenuButton: false,//收藏夹按钮
            showBookmarkPos: 1,//收藏夹位置
            showRestoreButton: false,//网页回收站
            showRestorePos: 1,//网页回收站位置
        },
        favMenu: {
            minWeidth: 150, // Assuming a default value for minWeidth
        },
        address: {
            enableRecommend: true,
            autoComplete: true,
            copyPasteHelper: false,
        },
        fav: {
            newTabShowBookmarkBar: false,
        },
        fontSize: {
            system: true,
            selfdes: false,
            size: 1, // Assuming 1 for 中
        },
        zoomRatio: {
            useSystemDpi: 0,
            notUse: 100,
        },
    }
    }
  }

  ,
  actions: {
    updateScreenConsole(screenConsole: ScreenConsoleApiModel) {
      this.screenConsoleState = screenConsole;
    }
  },
  getters: {

    getScreenConsole(state) { return state.screenConsoleState }

  },
  persist: {

    pick: ["screenConsoleState"]
  },
});